import { useRoutes } from 'react-router-dom'
import Home from '../views/Home'
import Detail from '../views/Detail'
import More from '../views/More'
import Play from '../views/Play'
import Error from '../views/Error'
const RouterView = () => {
    const routes = useRoutes(
        [
            {
                path: '/',
                element: <Home />
            },
            {
                path: '/more/:title',
                element: <More />
            },
            {
                path: '/detail/:id',
                element: <Detail />
            },
            {
                path: '/play/:name',
                element: <Play />
            },
            {
                path: '*',
                element:<Error/> 
            }
        ])
    return routes
}
export default RouterView